package com.itheima.datasource.c3p0;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * 访问的数量超过了过后
 *      后面的就获取不到了 等待超时时间后 就报错
 */
public class C3P0Demo2 {
    public static void main(String[] args) throws SQLException {
//        ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource ();


        //使用指定名称的配置
        ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource ("otherc3p0");

        for (int i = 1 ; i <= 10 ; i ++) {
            Connection connection = comboPooledDataSource.getConnection();
            System.out.println(connection);
        }
    }
}
